<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\ActiveForm;

/* @var $this yii\web\View */
/* @var $model common\models\MktSourceService */
/* @var $form yii\widgets\ActiveForm */
?>

<div class="mkt-source-service-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'user_id')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'service_other')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'service_device_rent')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'service_talnet')->textInput(['maxlength' => true]) ?>

<!--
    <//?= $form->field($model, 'service_area_id')->textInput(['maxlength' => true]) ?>
-->

    <?php echo $form->field($model, 'parent_service_area_id')->dropDownList(\yii\helpers\ArrayHelper::map(
        \common\models\MktArea::find()->children()->all(),
        'id',
        'title'
    ), ['prompt'=>'选择区域...', 'id'=>'parent_service_area_id'])->label('区域'); ?>

    <?php echo $form->field($model, 'service_area_id')->label('商圈')->widget(\kartik\depdrop\DepDrop::classname(), [
         'options' => ['id' => 'service_area_id'],
         'pluginOptions'=>[
             'depends'=>['parent_service_area_id'],
             'placeholder' => '选择商圈...',
             'url' => Url::to(['area/subcat'])
         ]
     ]); ?>


    <div class="form-group">
        <?= Html::submitButton($model->isNewRecord ? '创建' : '更新', ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
